import request from "@/utils/request";

// 查询合同列表
export function listContract(query) {
  return request({
    url: "/system/contract/list",
    method: "get",
    params: query,
  });
}

// 查询合同详细
export function getContract(id) {
  return request({
    url: "/system/contract/" + id,
    method: "get",
  });
}

// 新增合同
export function addContract(data) {
  return request({
    url: "/system/contract/add",
    method: "post",
    data: data,
  });
}

// 修改合同
export function updateContract(data) {
  return request({
    url: "/system/contract",
    method: "put",
    data: data,
  });
}

// 删除合同
export function delContract(id) {
  return request({
    url: "/system/contract/" + id,
    method: "delete",
  });
}

// 提交审核
export function submitApply(data) {
  return request({
    url: "/system/contract/submit",
    method: "post",
    data,
  });
}

// 出纳审核
export function cashierApply(data) {
  return request({
    url: "/system/contract/cashierApply",
    method: "post",
    data,
  });
}

// 出纳取消审核
export function cashierUnApply(data) {
  return request({
    url: "/system/contract/cashierUnApply",
    method: "post",
    data,
  });
}

// 校长审核
export function principalApprove(data) {
  return request({
    url: "/system/contract/principalApprove",
    method: "post",
    data,
  });
}

// 新增合同明细
export function addContractDetail(data) {
  return request({
    url: "/system/contract/label/add",
    method: "post",
    data,
  });
}

// 删除合同明细
export function delContractDetail(id) {
  return request({
    url: "/system/contract/label/" + id,
    method: "delete",
  });
}

// 新增付费明细
export function addContractPay(data) {
  return request({
    url: "/system/payLabel/add",
    method: "post",
    data,
  });
}

// 删除付费明细
export function delContractPay(id) {
  return request({
    url: "/system/payLabel/" + id,
    method: "delete",
  });
}

// 添加退费
export function refund(data) {
  return request({
    url: "/system/refund/add",
    method: "post",
    data,
  });
}

// 查询退费列表
export function getRefund(params) {
  return request({
    url: "/system/refund/list",
    method: "get",
    params,
  });
}

// 查询退费详情
export function getRefundDetail(id) {
  return request({
    url: `/system/refund/${id}`,
    method: "get",
  });
}

// 查询退费详情
export function AddReport(data) {
  return request({
    url: `/system/refund/report/add`,
    method: "post",
    data,
  });
}

// 同意退费
export function refundApprove(id) {
  return request({
    url: `/system/refund/approve/${id}/`,
    method: "get",
  });
}
// 业绩分配新增与修改方法(POST)
export function addPay(data) {
  return request({
    url: "/system/spd/add",
    method: "post",
    data,
  });
}
// 业绩分配新增与修改方法(POST)
export function delPay(ids) {
  return request({
    url: `/system/spd/${ids}`,
    method: "delete",
  });
}
